createPaymentRequest

HTTP method: POST

The createPaymentRequest method initiates a new payment by sending a payment request with all relevant payment information to the gateway. It is the preferred way of enabling a customer to pay via the AltaPay payment platform. It supports all the Alternative Payment Methods that are supported on our platform, and even though it redirects the customer to AltaPay, you (the merchant) keep complete control of the payment page. You can easily and dynamically adapt it so that, as far as your customer is concerned, they never leave your shop.

On receipt of the payment request, you get the payment page URL.

  • The Url element contains the URL you should direct your customers to.
  • The DynamicJavascriptUrl element contains a URL you can use to dynamically load the payment page in an iFrame. For more information, see Loading the payment page dynamically.
  • The AppUrl element contains a URL you can use to initiate the credit card wallet payment in app. For more information, see Initiate Credit Card Wallet payment in app.

For information about the payment flow process, see Payment flow process (Merchant API).

The URLs show a payment page that for credit card payments, without custom styling, looks like this:

For instructions on how to create custom styling for the payment page, see Styling the payment page (callback_form).

For information about the XML Schema Definition for API responses, see API Response structure (XML).

To enable surcharging (only for credit cards) on a terminal, using specific surcharging rules, contact us.

If surcharging is disabled on your terminal, but rules have been set up, the calculateSurcharge method calculates the surcharge based on those rules. As of January 2018, surcharging consumer credit cards in the EU, Norway, and Iceland is prohibited.

Request parameters

The API call does not happen in the browser, which means that users cannot tamper, or even see, the data posted to the gateway. You do not have to pass a check sum for the customer information.

The following parameters are mandatory for all integrations:

Parameter

Description

Type

Mandatory

terminal

The terminal determines the payment method and currency. For more information, see AltaPay's Payment Gateway. This is the title of your terminal, found under Home > Terminal Settings in the Merchant Interface. You can use variables in the terminal parameter. For example, if you want to call My EUR Terminal, you can set the terminal parameter value to 'My {currency} Terminal', where {currency} references the value of the currency parameter.

string

Yes

shop_orderid

This is the internal ID of the order in your webshop. In most integrations, you can use the same order ID for up to four orders. For PayPal, MobilePay and Vipps payments, you can only use it for a singe successful transaction. The shop_orderid value is posted back to you, so you know the order to which the payment refers.

 

[a-zA-Z0-9-]{1,100}

PayPal, MobilePay and Vipps only accept order IDs of 50 characters or less

Yes

amount

This is the payment amount. If you are setting up a subscription, it is the default amount for each capture. You must use a dot as the decimal separator, and the amount can have maximum 2 decimals.

float

Yes
Not required when setting up unscheduled agreement.

currency

This is the payment currency. It must be specified in an ISO-4217 format, either using the 3-digit numeric code, or the 3-letter character code. For more information about ISO-4217 currency codes, see https://en.wikipedia.org/wiki/ISO_4217.

Only allows payments in DKK or EUR.

Only allows payments in NOK

[0-9]{3} or

[A-Z]{3}

Yes

Select from the drop-down list to see the parameters relevant for that method/acquirer: